package com.koron.tool.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: laiguangming
 * @Date: 2022/10/28 16:04
 */
@Getter
@AllArgsConstructor
public enum InventoryCycleEnum {

    MONTH(1, "月"),
    QUARTER(2, "季度"),
    YEAR(3, "年");

    private Integer value;

    private String description;

    /**
     * 获取枚举的 Map, Entry(value, description)
     * @return
     */
    public static Map<Integer, String> getMap() {
        Map<Integer, String> map = new HashMap<>();
        InventoryCycleEnum[] enums = InventoryCycleEnum.values();
        for (InventoryCycleEnum inventoryCycleEnum : enums) {
            map.put(inventoryCycleEnum.getValue(), inventoryCycleEnum.getDescription());
        }
        return map;
    }


}
